#ifndef _TEXTEXCEPTION_H_
#define _TEXTEXCEPTION_H_

#include <iostream>
#include <exception>
#include <string>

#define DEBUG(...) (printf("DEBUG(%s:%d): ", __FILE__, __LINE__), printf(__VA_ARGS__))

using namespace std;

class TextException : public exception
{
   public:
      int rc;
      int errno;
      const char *text;

      TextException(const char *text)
      {
         this->text = text;
      }
      virtual ~TextException() throw()
      {
      }
      virtual const char* what() const throw()
      {
         return text;
      }
};

int textException(const char *fmt, ...);

#endif
